import { http } from "../plugins/axios";

//案情指标查询返回信息接口
export interface AnqingInfo {
  totalCount: string;
  kindName: string[];
  count: number[];
}

//指标查询发送参数接口
export interface ZhibiaoParam {
  startDate: string;
  endDate: string;
  zhiBiao: string;
}

//案件信息查询发送信息接口
export interface AJInfoParam {
  startDate: string;
  endDate: string;
  kindCode: string;
  name?: string;
  content?: string;
  pageSize: number;
  currentPage: number;
}

export interface AJInfo {
  totalCount: number;
  resultList: AJResultList[];
}

export interface AJResultList {
  案件编号: string;
  案件名称: string;
  文书编号: string;
  案由: string;
  受理日期: string;
  立案日期: string;
  办案单位: string;
  简要案情: string;
}

//行政处罚发送信息接口
export interface XZPunishParam {
  "startDate": string;
  "endDate": string;
  "pageSize": number;
  "currentPage": number;
  "anJianMingCheng"?: string;
  "anJianLeiBie"?: string;
  "xingming"?: string;
  "shenFenZheng"?: string;
  "faKuan"?: string;
  "juliu"?: string;
}

//行政处罚查询结果获取
export interface XZPunish {
  totalCount: number;
  resultList: XZPunishResultList[];
}

export interface XZPunishResultList {
  办案单位: string;
  案件编号: string;
  案件名称: string;
  案件类别: string;
  姓名: string;
  性别: string;
  民族: string;
  出生日期: string;
  年龄: string;
  身份证号: string;
  现住址: string;
  受案日期: string;
  简要案情: string;
  处罚情况: string;
  拘留期限: string;
  罚款金额: string;
  处罚文号: string;
  人员编号: string;
}

//刑事打击发送信息接口
export interface XSPunishParam {
  startDate: string;
  endDate: string;
  pageSize: number;
  currentPage: number;
  anJianMingCheng?: string;
  anJianLeiBie?: string;
  xingming?: string;
  shenFenZheng?: string;
  xingshicuoshi?: string;
}

//刑事打击返回结果
export interface XSPunish {
  totalCount: number
  resultList: XSPunishResultList[]
}

export interface XSPunishResultList {
  办案单位: string
  案件编号: string
  案件名称: string
  案件类别: string
  简要案情: string
  姓名: string
  性别: string
  民族: string
  出生日期: string
  年龄: string
  身份证号: string
  现住址: string
  受案日期: string
  立案日期: string
  破案日期: string
  刑拘日期: string
  逮捕日期: string
  取保日期: string
  起诉日期: string
  监视居住日期: string
  释放日期: string
  转行政处罚日期: string
  人员编号: string
  是否公开: string
}

export const UploadXZFile = "/api/anqing/UploadXingZheng"
export const DownloadXZFile = "/api/anqing/GetXingZhengMuBan"
export const UploadXSFile = "/api/anqing/UploadXingShi"
export const DownloadXSFile = "/api/anqing/GetXingShiMuBan"

class anqingApi {
  //获取案情信息查询结果
  getAJInfo(param: AJInfoParam) {
    return http.request<AJInfo>({
      //测试环境
      //url:'AnQing/GetZhiBiaoTest',
      //线上环境
      url: "/api/AnQing/GetAnjianxinxi",
      method: "post",
      params: param,
    });
  }
  //获取案情指标查询结果
  getZhibiaoInfo(param: ZhibiaoParam) {
    return http.request<AnqingInfo>({
      //线上环境
      url: "/api/AnQing/GetZhiBiao",
      method: "post",
      params: param,
    });
  }
  //获取行政处罚查询结果
  getXZPunish(param: XZPunishParam) {
    return http.request<XZPunish>({
      //线上环境
      url: "/api/AnQing/GetXingZhengChuFa",
      method: "post",
      params: param,
    });
  }
   //获取刑事打击查询结果
   getXSPunish(param: XSPunishParam) {
    return http.request<XSPunish>({
      //线上环境
      url: "/api/AnQing/GetXingShiChuFa",
      method: "post",
      params: param,
    });
  }
  //获取模板文件
  getFiles(url:string){
    return http.request({
      url:url,
      method:"get",
      responseType: 'blob',
    })
  }
  //上传文件
  uploadFiles(formData:FormData,url:string){
    return http.request<string>({
      url:url,
      method:"post",
      data:formData,
      headers: {
       'Content-Type': 'multipart/form-data',
      },
    })
  }
}


export default new anqingApi();
